import { requestClient as request } from '../request'

// 获取下载记录列表
export function getDownloadRecordList(params: any) {
  return request.get('/admin/DownloadRecord/index', params)
}

// 获取下载记录详情
export function getDownloadRecordInfo(params: { id: number }) {
  return request.get('/admin/DownloadRecord/read', params)
}

// 创建下载记录
export function createDownloadRecord(data: any) {
  return request.post('/admin/DownloadRecord/add', data)
}

// 编辑下载记录
export function updateDownloadRecord(data: any) {
  return request.post('/admin/DownloadRecord/edit', data)
}

// 删除下载记录
export function deleteDownloadRecord(ids: number[]) {
  return request.post('/admin/DownloadRecord/delete', { ids })
}

// 下载文件
export function downloadFile(id: number) {
  return request.get('/admin/DownloadRecord/download', { id })
}

// 导出数据
export function exportDownloadData(params: any) {
  return request.get('/admin/DownloadRecord/export', params, {
    responseType: 'blob',
  })
}
